home *** CD-ROM | disk | FTP | other *** search
/ Minami 48 / MINAMI48.ISO / Extra / winamp502_full.exe / $R0 / Winamp Modern / notifier.maki (.txt) < prev    next >
Winamp Compiled Maki Script  |  2003-11-17  |  12KB  |  520 lines

  1. /* Note: a decompiler is no invitation to steal code.
  2.    Please respect the the copyright */
  3.  
  4. #include "std.mi"
  5. Global ConfigAttribute ConfigAttribute3;
  6. Global ConfigAttribute ConfigAttribute4;
  7. Global ConfigAttribute ConfigAttribute5;
  8. Global ConfigAttribute ConfigAttribute6;
  9. Global ConfigAttribute ConfigAttribute7;
  10. Global ConfigAttribute ConfigAttribute8;
  11. Global ConfigAttribute ConfigAttribute9;
  12. Global ConfigAttribute ConfigAttribute10;
  13. Global ConfigAttribute ConfigAttribute11;
  14. Global ConfigAttribute ConfigAttribute12;
  15. Global ConfigAttribute ConfigAttribute13;
  16. Global ConfigAttribute ConfigAttribute14;
  17. Global ConfigAttribute ConfigAttribute15;
  18. Global ConfigAttribute ConfigAttribute16;
  19. Global ConfigAttribute ConfigAttribute17;
  20. Global ConfigAttribute ConfigAttribute18;
  21. Global ConfigAttribute ConfigAttribute19;
  22. Global ConfigAttribute ConfigAttribute20;
  23. Global ConfigAttribute ConfigAttribute21;
  24. Global ConfigAttribute ConfigAttribute22;
  25. Global ConfigAttribute ConfigAttribute23;
  26. Global ConfigAttribute ConfigAttribute24;
  27. Global ConfigAttribute ConfigAttribute25;
  28. Global ConfigAttribute ConfigAttribute26;
  29. Global ConfigAttribute ConfigAttribute27;
  30. Global ConfigAttribute ConfigAttribute28;
  31. Global ConfigAttribute ConfigAttribute29;
  32. Global Container Container103;
  33. Global Layout Layout104;
  34. Global Timer Timer105;
  35. Global String String106;
  36.  
  37. Function func0();
  38. Function func1855();
  39. Function func2100(Int 0);
  40. Function func2651();
  41. Function func2692();
  42. Function func2861(Int 0);
  43. Function func3229(String "0");
  44. Function func4586(String "0");
  45.  
  46. func0()
  47. {
  48. ConfigAttribute ConfigAttribute62;
  49. ConfigItem ConfigItem53;
  50. ConfigItem ConfigItem32;
  51. ConfigAttribute ConfigAttribute71;
  52. ConfigItem ConfigItem47;
  53. ConfigItem ConfigItem50;
  54. ConfigItem ConfigItem55;
  55. ConfigItem ConfigItem38;
  56. ConfigAttribute ConfigAttribute61;
  57. ConfigAttribute ConfigAttribute66;
  58. ConfigItem ConfigItem57;
  59. ConfigAttribute ConfigAttribute65;
  60. ConfigAttribute ConfigAttribute60;
  61. ConfigItem ConfigItem35;
  62. ConfigItem ConfigItem41;
  63. ConfigAttribute ConfigAttribute59;
  64. ConfigItem ConfigItem44;
  65. ConfigAttribute ConfigAttribute64;
  66. ConfigItem32 = Config.newItem(( "Winamp\ Modern"), ( "\{26E26319\-AECA\-4433\-B8F1\-F4A5BF2A9ED5\}"));
  67. ConfigItem35 = Config.newItem(( "Drawers"), ( "\{C338B30F\-2A04\-4b10\-871F\-4E9D52D62806\}"));
  68. ConfigItem38 = Config.newItem(( "Menus"), ( "\{12ED320E\-6813\-45ac\-9F8E\-78EE5B2B5F6D\}"));
  69. ConfigItem41 = Config.newItem(( "Main\ Windowshade\ Mode"), ( "\{58F07E21\-AE96\-4899\-B7BC\-3640B40029FB\}"));
  70. ConfigItem44 = Config.newItem(( "Vis\ Buttons"), ( "\{D70E3ABF\-D2FF\-4b82\-9A70\-4B5DF1A5D942\}"));
  71. ConfigItem47 = Config.newItem(( "Notifications"), ( "\{1AB968B3\-8687\-4a35\-BA70\-FCF6D92FB57F\}"));
  72. ConfigItem50 = Config.newItem(( "Songticker"), ( "\{7061FDE0\-0E12\-11D8\-BB41\-0050DA442EF3\}"));
  73. ConfigItem53 = Config.newItem(( "Hidden"), ( "\{E9C2D926\-53CA\-400f\-9A4D\-85E31755A4CF\}"));
  74. ConfigItem55 = Config.getItem(( "\{1828D28F\-78DD\-4647\-8532\-EBA504B8FC04\}"));
  75. ConfigItem57 = Config.getItem(( "\{6559CA61\-7EB2\-4415\-A8A9\-A2AEEF762B7F\}"));
  76. ConfigAttribute59 = ConfigItem55.newAttribute(( "Winamp\ Modern"), ( ""));
  77. ConfigAttribute59.setData(( "\{26E26319\-AECA\-4433\-B8F1\-F4A5BF2A9ED5\}"));
  78. ConfigAttribute60 = ConfigItem32.newAttribute(( "Drawers"), ( ""));
  79. ConfigAttribute60.setData(( "\{C338B30F\-2A04\-4b10\-871F\-4E9D52D62806\}"));
  80. ConfigAttribute61 = ConfigItem32.newAttribute(( "Menus"), ( ""));
  81. ConfigAttribute61.setData(( "\{12ED320E\-6813\-45ac\-9F8E\-78EE5B2B5F6D\}"));
  82. ConfigAttribute62 = ConfigItem32.newAttribute(( "Main\ Windowshade\ Mode"), ( ""));
  83. ConfigAttribute62.setData(( "\{58F07E21\-AE96\-4899\-B7BC\-3640B40029FB\}"));
  84. ConfigAttribute64 = ConfigItem32.newAttribute(( "Vis\ Shortcut\ Button"), ( ""));
  85. ConfigAttribute64.setData(( "\{D70E3ABF\-D2FF\-4b82\-9A70\-4B5DF1A5D942\}"));
  86. ConfigAttribute65 = ConfigItem32.newAttribute(( "Notifications"), ( ""));
  87. ConfigAttribute65.setData(( "\{1AB968B3\-8687\-4a35\-BA70\-FCF6D92FB57F\}"));
  88. ConfigAttribute66 = ConfigItem32.newAttribute(( "Songticker"), ( ""));
  89. ConfigAttribute66.setData(( "\{7061FDE0\-0E12\-11D8\-BB41\-0050DA442EF3\}"));
  90. ConfigAttribute3 = ConfigItem35.newAttribute(( "Animate\ Video\/Vis\ Drawer\ \(disabled\ if\ opacity\ \<\ 100\%\)"), ( "0"));
  91. ConfigAttribute4 = ConfigItem35.newAttribute(( "Animate\ Config\ Drawer"), ( "0"));
  92. ConfigAttribute71 = ConfigItem35.newAttribute(( "sep1"), ( ""));
  93. ConfigAttribute71.setData(( "\-"));
  94. ConfigAttribute7 = ConfigItem35.newAttribute(( "Open\ Video\/Vis\ from\ the\ top"), ( "0"));
  95. ConfigAttribute8 = ConfigItem35.newAttribute(( "Open\ Video\/Vis\ from\ the\ bottom"), ( "1"));
  96. ConfigAttribute9 = ConfigItem35.newAttribute(( "Bypass\ setting\ to\ keep\ in\ screen"), ( "1"));
  97. if(( ConfigAttribute7.getData() == ( "1"))) {
  98. ConfigAttribute7.onDataChanged();
  99. } else {
  100. ConfigAttribute8.onDataChanged();
  101. }
  102. ConfigAttribute11 = ConfigItem38.newAttribute(( "Show\ Menus\ in\ Main\ Window"), ( "1"));
  103. ConfigAttribute12 = ConfigItem38.newAttribute(( "Show\ Menus\ in\ Playlist\ Editor"), ( "1"));
  104. ConfigAttribute13 = ConfigItem38.newAttribute(( "Show\ Menus\ in\ Media\ Library"), ( "1"));
  105. ConfigAttribute71 = ConfigItem32.newAttribute(( "sep1"), ( ""));
  106. ConfigAttribute71.setData(( "\-"));
  107. ConfigAttribute5 = ConfigItem32.newAttribute(( "Detach\ Vis\ Window"), ( "0"));
  108. ConfigAttribute6 = ConfigItem32.newAttribute(( "Detach\ Video\ Window"), ( "0"));
  109. ConfigAttribute10 = ConfigItem57.newAttribute(( "Equalizer\ Alt\+G"), ( "0"));
  110. ConfigAttribute71 = ConfigItem32.newAttribute(( "sep2"), ( ""));
  111. ConfigAttribute71.setData(( "\-"));
  112. ConfigAttribute17 = ConfigItem32.newAttribute(( "Enable\ Beat\ Visualization"), ( "1"));
  113. ConfigAttribute14 = ConfigItem41.newAttribute(( "Link\ Position\ and\ Width"), ( "1"));
  114. ConfigAttribute15 = ConfigItem41.newAttribute(( "Link\ Position\,\ Unlink\ Width"), ( "0"));
  115. ConfigAttribute16 = ConfigItem41.newAttribute(( "Unlink\ Position\ and\ Width"), ( "0"));
  116. ConfigAttribute19 = ConfigItem44.newAttribute(( "Open\ Context\ Menu"), ( "1"));
  117. ConfigAttribute18 = ConfigItem44.newAttribute(( "Open\ Configuration"), ( "0"));
  118. ConfigAttribute22 = ConfigItem47.newAttribute(( "Show\ always"), ( "0"));
  119. ConfigAttribute21 = ConfigItem47.newAttribute(( "Show\ with\ windowshade\ and\ when\ minimized"), ( "0"));
  120. ConfigAttribute20 = ConfigItem47.newAttribute(( "Show\ only\ when\ minimized"), ( "0"));
  121. ConfigAttribute23 = ConfigItem47.newAttribute(( "Never\ show"), ( "1"));
  122. ConfigAttribute71 = ConfigItem47.newAttribute(( "sep1"), ( ""));
  123. ConfigAttribute71.setData(( "\-"));
  124. ConfigAttribute27 = ConfigItem47.newAttribute(( "Disable\ in\ fullscreen"), ( "1"));
  125. ConfigAttribute24 = ConfigItem53.newAttribute(( "Notifications\ fade\ in\ time"), ( "1000"));
  126. ConfigAttribute25 = ConfigItem53.newAttribute(( "Notifications\ fade\ out\ time"), ( "5000"));
  127. ConfigAttribute26 = ConfigItem53.newAttribute(( "Notifications\ display\ time"), ( "2000"));
  128. ConfigAttribute28 = ConfigItem50.newAttribute(( "Enable\ Songticker\ scrolling"), ( "1"));
  129. ConfigAttribute29 = ConfigItem50.newAttribute(( "Disable\ Songticker\ scrolling"), ( "0"));
  130. return Null;
  131. }
  132.  
  133. System.onScriptLoaded()
  134. {
  135. func0();
  136. Timer105 = ( new Timer);
  137. return Null;
  138. }
  139.  
  140. System.onScriptUnloading()
  141. {
  142. delete Timer105;
  143. return Null;
  144. }
  145.  
  146. Int System.onShowNotification()
  147. {
  148. String String108;
  149. if(func2100(1)) {
  150. return Null;
  151. }
  152. func2692();
  153. if(( System.getStatus() == 1)) {
  154. String108 = ( "Playing");
  155. }
  156. if(( System.getStatus() == ( - 1))) {
  157. String108 = ( "Playback\ Paused");
  158. }
  159. if(( System.getStatus() == 0)) {
  160. String108 = ( "Playback\ Stopped");
  161. }
  162. func2861(func3229(String108));
  163. complete;
  164. return 1;
  165. }
  166.  
  167. System.onTitleChange(String newtitle)
  168. {
  169. if(( String106 == newtitle)) {
  170. return Null;
  171. }
  172. if(( System.Strleft(newtitle, 1) == ( "\["))) {
  173. if(( ( System.Strleft(newtitle, 7) == ( "\[Buffer")) || ( System.Strleft(newtitle, 4) == ( "\[ICY")))) {
  174. return Null;
  175. }
  176. }
  177. String106 = newtitle;
  178. func1855();
  179. return Null;
  180. }
  181.  
  182. func1855()
  183. {
  184. if(func2100(0)) {
  185. return Null;
  186. }
  187. func2692();
  188. func2861(func3229(( "")));
  189. return Null;
  190. }
  191.  
  192. System.onPlay()
  193. {
  194. if(func2100(0)) {
  195. return Null;
  196. }
  197. func2692();
  198. func2861(func3229(( "Playing")));
  199. return Null;
  200. }
  201.  
  202. System.onPause()
  203. {
  204. if(func2100(0)) {
  205. return Null;
  206. }
  207. func2692();
  208. func2861(func4586(( "Playback\ Paused")));
  209. return Null;
  210. }
  211.  
  212. System.onResume()
  213. {
  214. if(func2100(0)) {
  215. return Null;
  216. }
  217. func2692();
  218. func2861(func3229(( "Resuming\ Playback")));
  219. return Null;
  220. }
  221.  
  222. System.onStop()
  223. {
  224. if(func2100(0)) {
  225. return Null;
  226. }
  227. func2692();
  228. func2861(func4586(( "End\ of\ Playback")));
  229. return Null;
  230. }
  231.  
  232. func2100(Int 0)
  233. {
  234. Container Container123;
  235. Layout Layout124;
  236. if(( ( ( ! Int121) && ( ConfigAttribute27.getData() == ( "1"))) && System.isVideoFullscreen())) {
  237. return 1;
  238. }
  239. if(( ConfigAttribute23.getData() == ( "1"))) {
  240. return 1;
  241. }
  242. if(( ( ConfigAttribute20.getData() == ( "1")) && ( ! System.isMinimized()))) {
  243. return 1;
  244. }
  245. if(( ConfigAttribute21.getData() == ( "1"))) {
  246. if(System.isMinimized()) {
  247. return 0;
  248. }
  249. Container123 = System.getContainer(( "main"));
  250. if(( ! Container123)) {
  251. return 1;
  252. }
  253. Layout124 = Container123.getCurLayout();
  254. if(( ! Layout124)) {
  255. return 1;
  256. }
  257. if(( Layout124.getId() != ( "shade"))) {
  258. return 1;
  259. }
  260. }
  261. return 0;
  262. }
  263.  
  264. Layout104.onTargetReached()
  265. {
  266. Int Int126;
  267. Int126 = Layout104.getAlpha();
  268. if(( Int126 == 255)) {
  269. Timer105.setDelay(System.StringToInteger(ConfigAttribute26.getData()));
  270. Timer105.start();
  271. } else {
  272. if(( Int126 == 0)) {
  273. func2651();
  274. }
  275. }
  276. return Null;
  277. }
  278.  
  279. Timer105.onTimer()
  280. {
  281. Timer105.stop();
  282. if(Layout104.isTransparencySafe()) {
  283. Layout104.setTargetA(0);
  284. Layout104.setTargetSpeed(( System.StringToInteger(ConfigAttribute25.getData()) / 1000));
  285. Layout104.gotoTarget();
  286. } else {
  287. func2651();
  288. }
  289. return Null;
  290. }
  291.  
  292. Layout104.onLeftButtonDown(int x, int y)
  293. {
  294. Timer105.stop();
  295. Layout104.cancelTarget();
  296. func2651();
  297. System.restoreApplication();
  298. System.activateApplication();
  299. return Null;
  300. }
  301.  
  302. func2651()
  303. {
  304. Container103.close();
  305. Container103 = Null;
  306. Layout104 = Null;
  307. return Null;
  308. }
  309.  
  310. func2692()
  311. {
  312. if(( Container103 == Null)) {
  313. Container103 = System.newDynamicContainer(( "notifier"));
  314. if(( ! Container103)) {
  315. return Null;
  316. }
  317. if(System.isDesktopAlphaAvailable()) {
  318. Layout104 = Container103.getLayout(( "desktopalpha"));
  319. } else {
  320. Layout104 = Container103.getLayout(( "normal"));
  321. }
  322. if(( ! Layout104)) {
  323. return Null;
  324. }
  325. } else {
  326. Layout104.cancelTarget();
  327. Timer105.stop();
  328. }
  329. return Null;
  330. }
  331.  
  332. func2861(Int 0)
  333. {
  334. Int Int139;
  335. Int Int137;
  336. Int134 = ( Int134 + 32);
  337. Int137 = ( ( ( System.getViewportWidth() + System.getViewportLeft()) - Int134) - 2);
  338. Int139 = ( ( ( System.getViewportHeight() + System.getViewportTop()) - 80) - 2);
  339. Layout104.resize(Int137, Int139, Int134, 80);
  340. if(Layout104.isTransparencySafe()) {
  341. Layout104.show();
  342. Layout104.setTargetA(255);
  343. Layout104.setTargetX(Int137);
  344. Layout104.setTargetY(Int139);
  345. Layout104.setTargetW(Int134);
  346. Layout104.setTargetH(80);
  347. Layout104.setTargetSpeed(( System.StringToInteger(ConfigAttribute24.getData()) / 1000));
  348. Layout104.gotoTarget();
  349. } else {
  350. Layout104.setAlpha(255);
  351. Layout104.show();
  352. Timer105.setDelay(System.StringToInteger(ConfigAttribute26.getData()));
  353. Timer105.start();
  354. }
  355. return Null;
  356. }
  357.  
  358. func3229(String "0")
  359. {
  360. String String174;
  361. String String162;
  362. Text Text151;
  363. Text Text153;
  364. String String166;
  365. Text Text149;
  366. Text Text145;
  367. Int Int141;
  368. String String172;
  369. Text Text147;
  370. Int Int142;
  371. Text Text155;
  372. Group Group143;
  373. Int141 = 0;
  374. Int142 = 0;
  375. Group143 = Layout104;
  376. Text145 = Group143.findObject(( "plentry"));
  377. Text147 = Group143.findObject(( "nexttrack"));
  378. Text149 = Group143.findObject(( "title"));
  379. Text151 = Group143.findObject(( "album"));
  380. Text153 = Group143.findObject(( "artist"));
  381. Text155 = Group143.findObject(( "endofplayback"));
  382. System.debugString(( ( "got\ callback\ for\ ") + System.getPlayItemString()), 0);
  383. if(( System.Strleft(System.getPlayItemString(), 7) == ( "http\:\/\/"))) {
  384. Int142 = 1;
  385. }
  386. if(Text155) {
  387. Text155.hide();
  388. }
  389. if(Text145) {
  390. Text145.setText(( ( System.integerToString(( System.getPlaylistIndex() + 1)) + ( "\/")) + System.integerToString(System.getPlaylistLength())));
  391. Text145.show();
  392. }
  393. if(Text147) {
  394. if(( String140 == ( ""))) {
  395. if(( ! Int142)) {
  396. if(( ! System.isVideo())) {
  397. Text147.setText(( "New\ track"));
  398. } else {
  399. Text147.setText(( "New\ video"));
  400. }
  401. } else {
  402. Text147.setText(( "On\ air"));
  403. }
  404. } else {
  405. Text147.setText(String140);
  406. }
  407. Text147.show();
  408. }
  409. if(Text149) {
  410. if(( ! Int142)) {
  411. Text149.setXmlParam(( "ticker"), ( "0"));
  412. Text149.setXmlParam(( "display"), ( ""));
  413. String162 = System.getPlayItemMetaDataString(( "title"));
  414. if(( String162 == ( ""))) {
  415. String162 = System.getPlayItemDisplayTitle();
  416. }
  417. String166 = System.getPlayItemMetaDataString(( "length"));
  418. if(( String166 != ( ""))) {
  419. String162 = ( String162 + ( ( ( "\ \(") + System.integerToTime(System.StringToInteger(String166))) + ( "\)")));
  420. }
  421. Text149.setText(String162);
  422. } else {
  423. Text149.setXmlParam(( "ticker"), ( "1"));
  424. Text149.setXmlParam(( "display"), ( "songtitle"));
  425. Text149.setText(( ""));
  426. }
  427. Text149.show();
  428. }
  429. if(Text153) {
  430. if(( ! Int142)) {
  431. if(System.isVideo()) {
  432. Text153.setText(( ""));
  433. } else {
  434. Text153.setText(System.getPlayItemMetaDataString(( "artist")));
  435. }
  436. } else {
  437. if(System.isVideo()) {
  438. Text153.setText(( "Internet\ TV"));
  439. } else {
  440. Text153.setText(( "Internet\ Radio"));
  441. }
  442. }
  443. Text153.show();
  444. }
  445. if(Text151) {
  446. if(( ( ! Int142) && ( ! System.isVideo()))) {
  447. Text151.setXmlParam(( "display"), ( ""));
  448. String172 = System.getPlayItemMetaDataString(( "album"));
  449. String174 = System.getPlayItemMetaDataString(( "track"));
  450. if(( ( String174 != ( "")) && ( String174 != ( "\-1")))) {
  451. String172 = ( String172 + ( ( ( "\ \(Track\ ") + String174) + ( "\)")));
  452. }
  453. Text151.setText(String172);
  454. } else {
  455. Text151.setText(( ""));
  456. Text151.setXmlParam(( "display"), ( "songinfo"));
  457. }
  458. Text151.show();
  459. }
  460. Int141 = Text153.getAutoWidth();
  461. if(( Int141 > Text151.getAutoWidth())) {
  462. Int141 = Text151.getAutoWidth();
  463. }
  464. if(( Int141 > Text149.getAutoWidth())) {
  465. Int141 = Text149.getAutoWidth();
  466. }
  467. if(( Int141 > 128)) {
  468. Int141 = 128;
  469. }
  470. if(( Int141 < ( System.getViewportWidth() / 4))) {
  471. Int141 = ( System.getViewportWidth() / 4);
  472. }
  473. return Int141;
  474. }
  475.  
  476. func4586(String "0")
  477. {
  478. Text Text182;
  479. Text Text185;
  480. Text Text186;
  481. Group Group180;
  482. Text Text181;
  483. Int Int187;
  484. Text Text183;
  485. Text Text184;
  486. Group180 = Layout104;
  487. Text181 = Group180.findObject(( "plentry"));
  488. Text182 = Group180.findObject(( "nexttrack"));
  489. Text183 = Group180.findObject(( "title"));
  490. Text184 = Group180.findObject(( "album"));
  491. Text185 = Group180.findObject(( "artist"));
  492. Text186 = Group180.findObject(( "endofplayback"));
  493. if(Text181) {
  494. Text181.hide();
  495. }
  496. if(Text182) {
  497. Text182.hide();
  498. }
  499. if(Text183) {
  500. Text183.hide();
  501. }
  502. if(Text185) {
  503. Text185.hide();
  504. }
  505. if(Text184) {
  506. Text184.hide();
  507. }
  508. if(Text186) {
  509. Text186.setText(String179);
  510. Int187 = Text186.getAutoWidth();
  511. Text186.show();
  512. if(( Int187 < 128)) {
  513. return Int187;
  514. }
  515. }
  516. return 128;
  517. }
  518.  
  519.  
  520.